package com.chiry.business.remote;

import com.chiry.business.entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

/**
 * 对象存储 Feign 客户端
 *
 * @author: leisurexi
 * @date: 2020-12-13 18:49
 */
@FeignClient(name = "obj-storage-server")
public interface ObjStorageClient {

    @PostMapping(value = "/api/obj-storage/upload/file", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Result<String> upload(@RequestPart("file") MultipartFile file, @RequestParam("fileType") Integer fileType, @RequestParam("bucketName") String bucketName);

}
